function UM()
{

	// singleton
	if ( UM.prototype._singletonInstance ) {
	      return UM.prototype._singletonInstance;
	}
	UM.prototype._singletonInstance = this;
	
	var users = []; // "users" array, contains all the "user" objects		
	
	// almost copy here the ObjectManager Class
		
		/*
		 * PUBLIC
		 * Push one user in the users array
		 */
		
		function push(data)
		{
			
			$.each(data, function(index, array) // create the array, index count the iterations, array is the content
			{
				console.log(array['id']);
				console.log(array['username']);
				var uid = array['id'];
				var user = new User(array); // create an item and give it the array with the content
				console.log(user.getUsername());
				users[uid] = user; // the associative array "items" collects all the items by id
				console.log(users[uid]);
				onPush(user);
			});
			
			console.log(users);
			console.log('pushItem(): success');
		};
		
		
		/*
		 * PRIVATE
		 * Get data from user(s) the BDD in a JSON format
		 */
		
		this.get = function(mode, uid, bounds, selector) 
		{
			switch(mode)
			{
				// load users with geographical bounds
				case 'bounds' : url = '/'+BASEPATH+'user/get/bounds/'; var data = bounds; console.log(bounds); break;
				// load all users
				case 'users' : url = '/'+BASEPATH+'user/get/users/'; break;
				// load only one user
				case 'user' : url = '/'+BASEPATH+'user/get/user/'+uid; break;
				// load only one user min information
				case 'mini' : url = '/'+BASEPATH+'U/get/mini/'+uid; break;
			}
			
			$.ajax({
				type: 'POST',
				url: url,
				data: { data : data },
				timeout: 3000,
				success: function(data)
				{
					console.log('here'+data);
					switch(mode)
					{
						case 'bounds' :
							/*
							// update the array
							// make sure we reset the array
							users = []; 
							// push all items retrieved
							push(data);
							// display markers on map
							// to adapt
							
							//MapManager.displayOnMap();
							
							if(page == 'users')
							{
								// refresh list 
								displayList(sortBy);
							}
							
							// display success message
							display_alert('list updated', '#alert_area', 'success');
							console.log('get(): success');*/
						break;
						case 'users' :
							/*// refresh list 
							displayList(sortBy);
							// display markers on map
							MapManager.displayOnMap();
							// display success message
							display_alert('list updated', '#alert_area', 'success');
							console.log('get(): success');*/
						break;
						case 'user' :
							console.log(data);
							push(data);
							//MapManager.createCoordinates();*/
						break;
						// one small box with the user info
						case 'mini' :
							onGetMini(data, selector);
						break;
					}			
				},
				error: function() { display_alert('connexion problem', '#alert_area', 'error'); console.log('get(): error'); }
			});
		};
		
		/*this.displayUserBox = function(id, uid)
		{
			
			console.log('displayUserbox : '+id+' uid:'+uid );
			if(users[uid] != null)
			{

				console.log('here');
				var msg = ''
					+  '<img class="pull-left photo-small" src="'+users[uid].displayPhoto()+'">'
					+  users[uid].getUsername() ;
				console.log('#'+id+' .ubox'+uid);
				
				$('#'+id+' .ubox'+uid).html(msg);
				/*
				$('.ubox'+uid).each(function()
				{
					$(this).html(msg);
					console.log(this);
				});*/
				/*
			}
			else
			{
				console.log('look for an user'+uid);
				get('userbox', id, uid, null);
			}
		};
		
		function onPush(user)
		{
			UMI.displayUser(user);
		}*/
		
		function onGetMini(data, selector)
		{
			// take the data from 0 the only result
			var user = new U(data[0]); // create an user and give it the array with the content
			console.log('on'+user);
			UMC.display_miniBox(user, selector);
		}
		
		console.log('UM initialized');
}
console.log('UM loaded');
